import Vue from 'vue'
import VueRouter from 'vue-router'
// 引入组件

import AndWarning from '../src/AndWarning.vue'
import AndWarningNew from '../src/AndWarningNew.vue'
import AutoEqScreen from '../src/AutoEqScreen.vue'
import BjScreen from '../src/BjScreen.vue'
import CjScreen from '../src/CjScreen.vue'
import CjScreenA from '../src/CjScreenA.vue'
import CjScreenB from '../src/CjScreenB.vue'
import CxScreen from '../src/CxScreen.vue'
import CxScreen2 from '../src/CxScreen2.vue'
import EqScreen from '../src/EqScreen.vue'
import WarehouseA from '../src/WarehouseA.vue'
import WarehouseB from '../src/WarehouseB.vue'
import ScScreen from '../src/ScScreen.vue'
import ScScreenGc from '../src/ScScreenGc.vue'

import ProductInfo from '../src/views/productInfo/index.vue'
import WarehouseInfo from '../src/views/warehouseInfo/index.vue'
import GlobalInfo from '../src/views/globalInfo/index.vue'
import InspectInfo from '../src/views/inspectInfo/index.vue'
import ZhuangpeiProductInfo from '../src/views/zhuangpeiProductInfo/index.vue'



// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter)

const routes = [
  {
    path: '/InspectInfo',
    name: 'InspectInfo',
    component: InspectInfo,
  },
  {
    path: '/GlobalInfo',
    name: 'GlobalInfo',
    component: GlobalInfo,
  },
  {
    path: '/WarehouseInfo',
    name: 'WarehouseInfo',
    component: WarehouseInfo,
  },
  {
    path: '/ProductInfo',
    name: 'ProductInfo',
    component: ProductInfo,
  },
    {
    path: '/ZhuangpeiProductInfo',
    name: 'ZhuangpeiProductInfo',
    component: ZhuangpeiProductInfo,
  },
  {
    path: '/AutoEqScreen',
    name: 'AutoEqScreen',
    component: AutoEqScreen,
  },
  {
    path: '/BjScreen',
    name: 'BjScreen',
    component: BjScreen,
  },

  {
    path: '/EqScreen',
    name: 'EqScreen',
    component: EqScreen,
  },
  {
    path: '/WarehouseA',
    name: 'WarehouseA',
    component: WarehouseA,
  },
  {
    path: '/WarehouseB',
    name: '/WarehouseB',
    component: WarehouseB,
  },
  {
    path: '/AndWarning',
    name: 'AndWarning',
    component: AndWarning,
  },
  {
    path: '/AndWarningNew',
    name: 'AndWarningNew',
    component: AndWarningNew,
  },
  {
    path: '/CxScreen',
    name: 'CxScreen',
    component: CxScreen,
    query: {
      cx: window.cx,
    },
  },
  {
    path: '/CxScreen2',
    name: 'CxScreen2',
    component: CxScreen2,
  },
  {
    path: '/CjScreen',
    name: 'CjScreen',
    component: CjScreen,
    query: {
      cj: window.cj,
    },
  },
  {
    path: '/CjScreenA',
    name: 'CjScreenA',
    component: CjScreenA,
  },
  {
    path: '/CjScreenB',
    name: 'CjScreenB',
    component: CjScreenB,
  },
  {
    path: '/ScScreen',
    name: 'ScScreen',
    component: ScScreen,
  },
  {
    path: '/ScScreenGc',
    name: 'ScScreenGc',
    component: ScScreenGc,
  },
]

var router = new VueRouter({
  routes,
})
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch((err) => err)
}

export default router
